import request from '@/utils/request'

export function getUsers (data) {
  return request({
    url: '/users',
    method: 'get',
    params: data
  })
}

export function getUser (data) {
  return request({
    url: '/user',
    method: 'get',
    params: data
  })
}

export function addUser (data) {
  return request({
    url: '/user',
    method: 'post',
    data
  })
}

export function editUser (data) {
  return request({
    url: '/user',
    method: 'put',
    data
  })
}

export function updateUser (id, data) {
  return request({
    url: `/user/${id}`,
    method: 'put',
    data
  })
}

export function deleteUser (data) {
  return request({
    url: '/user',
    method: 'delete',
    params: data
  })
}

export function resetUser (data) {
  return request({
    url: '/user/reset',
    method: 'get',
    params: data
  })
}
